package com.shinewind.common.config.sms.config;

import com.shinewind.common.config.sms.properties.SmsClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(SmsClient.class)
@ConditionalOnProperty(value = "sms.enable",havingValue = "true")
public class SmsConfig {
    @Bean("smsRequest")
    public SmsClient.Request getSmsClientRequest(){
        SmsClient.Request request = new SmsClient.Request();
        return request;
    }

    @Bean("smsClient")
    public SmsClient getSmsClient(){
        SmsClient smsClient = new SmsClient();
        return smsClient;
    }
}